package br.com.hotstar.util.resourceBundle;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

import br.com.hotstar.control.annotation.TreatException;
import br.com.hotstar.model.DAO.ORM.annotation.Transaction;

@WebFilter("/*")
public class SetLocale implements Filter {


    public SetLocale() {

    }

	public void destroy() {

	}

	@TreatException
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

	
		LocaleSafe.setLocale(request.getLocale());
		
		chain.doFilter(request, response);
	}


	public void init(FilterConfig fConfig) throws ServletException {

	}

}
